home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11990 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: coranto.ucs.mun.ca!usenet
  2. From: saustin@terra.nlnet.nf.ca (Steve Austin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Can you overload a constructor?
  5. Date: Sun, 17 Mar 1996 16:45:04 GMT
  6. Organization: Kickham Productions
  7. Message-ID: <4ihfi4$5pu@coranto.ucs.mun.ca>
  8. References: <Do859K.K9B@watserv3.uwaterloo.ca> <31493335.8C5@germany.ncr.com>
  9. NNTP-Posting-Host: n104h131.nlnet.nf.ca
  10. X-Newsreader: Forte Agent .99b.112
  11.  
  12. Arnold Bursian <arnold.bursian@germany.ncr.com> wrote:
  13. >jfournie@sciborg.uwaterloo.ca wrote:
  14. >> I am new to C++ and just wanted to make sure it
  15. >> was OK to overload a constructor.  gnu c++
  16. >> doesn't have a problem with it, but is it normally
  17. >> done?
  18.  
  19. >Sure, you do it all the time! Just make sure you're calling one of the parent's constructors.
  20.  
  21. [snip]
  22.  
  23. The original question was can you *overload* a constructor, not about
  24. constructors with parameters in derived classes. This is not what
  25. overloading means.
  26.  
  27. Of course you can overload a constructor - for example, the compiler
  28. will generate a default copy constructor if you don't define your own.
  29. Same function name, different signature, defined in the same scope.
  30.  
  31. Steve
  32.  
  33.  
  34.